<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> -->
</head>

<body>

</body>
<script type="module">
    import "https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js";

    console.log(1111, axios);

    /* axios({
        method: "",
        // baseURL:"",
        url: "",
        params: {

        },

        headers: {

        },
        data: {

        },

        responseType: "json"
    })
 */

    // 全局 axios 默认值
    // axios.defaults.baseURL = 'https://api.example.com';
    // axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
    // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

    // axios(config)
    // axios.get(url, config)
    // axios.post(url, data, config)



    // 自己的服务器 -> 接口: http://43.138.81.225/api/xxx
    // 第三方服务器 -> 短信登录: https://www.mysubmail.com/api/sendCode


    // 创建实例时配置默认值
    var instance = axios.create({
        baseURL: 'https://some-domain.com/api/',
        timeout: 1000,
        headers: { 'X-Custom-Header': 'foobar' },
    })

    console.log(2222, instance);

    // 创建实例后修改默认值
    // instance.defaults.headers.common['Authorization'] = AUTH_TOKEN;

    // instance.get()
    // instance.post()







    // var codeInstance = axios.create({
    //     baseURL: "https://www.mysubmail.com"
    // })

    // // 创建实例后修改默认值
    // codeInstance.defaults.headers.common['Authorization'] = AUTH_TOKEN;


    // codeInstance.get()
    // codeInstance.post()








</script>

</html>